import { getrolelist } from "@/request/api";
const state = {
    rolelist:[]
};
const getters = {
    getrole(state){
        return state.rolelist;
    }
}
const mutations = {
    REQ_ROLELIST(state,payload){
        state.rolelist = payload
    }
}
const actions = {
    getroleAction({commit}){
        getrolelist().then((res)=>{
            commit('REQ_ROLELIST',res.list)
        })
    }
}
export default{
    state,
    getters,
    mutations,
    actions,
    //命名空间
    namespaced:true
}